home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-15 | 2.1 KB | 48 lines | [TEXT/MMCC] |
-
- The Random Library
-
- The Random Numbers library exports a single module, Random. This module
- exports an interface to various classes, each representing a random
- distribution.
-
- <random-distribution> [Abstract Class]
- <uniform-distribution> [Abstract Class]
- <unit-uniform-distribution> [Class]
- <real-uniform-distribution> [Class]
- <integer-uniform-distribution> [Class]
- <exponential-distribution> [Class]
- <normal-distribution> [Class]
- These classes are the random distributions defined in the library. The
- abstract classes <random-distribution> and <uniform-distribution> are not
- instantiable. The make method for the instantiable classes accepts the
- keyword seed:, used to seed the distribution. The seed must be a
- positive integer.
-
- random (distribution :: <random-distribution>) [Generic Function]
- This function returns a random number from distribution.
- Each of the instantiable classes above has a method for random.
-
- *dylan-random-seed* [Variable]
- *dylan-random-distribution* [Variable]
- random-uniform (#key from, to) [Constant Method]
- seed-random! (integer) [Constant Method]
- These variables and functions are provided so that programmers will not
- have to create their own random distributions just to get simple random
- numbers.
-
- The variable *dylan-random-seed* contains the default seed for all
- <random-distribution>s. (A different seed can be given through the
- seed: keyword argument.) The variable *dylan-random-distribution*
- contains a global unit uniform distribution.
-
- The function random-uniform returns a random number from a uniform
- distribution. The bounds of the uniform distribution are given by
- keywords from: and to: (which default to 0.0d0 and 1.0d0). The type of
- the number returned is same as the types of the keyword arguments (whose
- types must be identical). The function uses *dylan-random-distribution*
- to generate this number.
-
- The function seed-random! sets *dylan-random-seed* to integer (which
- must be positive) and sets *dylan-random-distribution* to a new unit
- uniform seeded to integer.
-